class Bank(object):

    def __init__(self, balance):
        """
        :type balance: List[int]
        """
        self.account = balance
        self.n = len(self.account)


    def transfer(self, account1, account2, money):
        """
        :type account1: int
        :type account2: int
        :type money: int
        :rtype: bool
        """
        if account1 <= self.n and account2 <= self.n:
            if self.account[account1 - 1] >= money:
                self.account[account1 - 1] -= money
                self.account[account2 - 1] += money
                return True
            else:
                return False
        else:
            return False



    def deposit(self, account, money):
        """
        :type account: int
        :type money: int
        :rtype: bool
        """
        if account <= self.n:
            self.account[account - 1] += money
            return True
        else:
            return False


    def withdraw(self, account, money):
        """
        :type account: int
        :type money: int
        :rtype: bool
        """
        if account <= self.n:
            if self.account[account - 1] >= money:
                self.account[account - 1] -= money
                return True
            else:
                return False
        else:
            return False